using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._RasterAnalysisTools._UseProximity
{
    /// <summary>
    /// <para>Determine Travel Cost Paths To Destinations</para>
    /// <para>Calculates specific paths between known sources and known destinations.</para>
    /// <para>计算已知源和已知目标之间的特定路径。</para>
    /// </summary>    
    [DisplayName("Determine Travel Cost Paths To Destinations")]
    public class DetermineTravelCostPathsToDestinations : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public DetermineTravelCostPathsToDestinations()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_inputDestinationRasterOrFeatures">
        /// <para>Input Destination Raster or Features</para>
        /// <para><xdoc>
        ///   <para>An image service or feature service that identifies the cells from which the least-cost path is determined to the least costly source.</para>
        ///   <para>If the input is an image service, the input consists of cells that have valid values (zero is a valid value), and the remaining cells must be assigned NoData.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>一种影像服务或要素服务，用于标识从中确定成本最低路径到成本最低源的像元。</para>
        ///   <para>如果输入是影像服务，则输入由具有有效值的像元组成（零为有效值），并且必须为其余像元分配 NoData。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_inputCostDistanceRaster">
        /// <para>Input Cost Distance Raster</para>
        /// <para><xdoc>
        ///   <para>The name of a cost distance image service to be used to determine the least-cost path from the destination locations to a source.</para>
        ///   <para>The cost distance raster is usually created with the Calculate Travel Cost tool. The cost distance raster stores, for each cell, the minimum accumulative cost distance over a cost surface from each cell to a set of source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于确定从目标位置到源的最低成本路径的成本距离影像服务的名称。</para>
        ///   <para>成本距离栅格通常使用计算差旅成本工具创建。成本距离栅格存储每个像元在成本图面上从每个像元到一组源像元的最小累积成本距离。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_inputCostBacklinkRaster">
        /// <para>Input Cost Backlink Raster</para>
        /// <para><xdoc>
        ///   <para>The name of a cost back link raster used to determine the path to return to a source via the least-cost path.</para>
        ///   <para>For each cell in the back link raster, a value identifies the neighbor that is the next cell on the least accumulative cost path from the cell to a single source cell or set of source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>成本回溯链接栅格的名称，用于确定通过成本最低路径返回源的路径。</para>
        ///   <para>对于反向链接栅格中的每个像元，一个值用于标识从像元到单个源像元或一组源像元的累积成本最低路径上的下一个像元。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_outputName">
        /// <para>Output Name</para>
        /// <para><xdoc>
        ///   <para>The name of the output travel cost paths raster service.</para>
        ///   <para>The default name is based on the tool name and the input layer name. If the layer name already exists, you will be prompted to provide another name.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出差旅成本路径栅格服务的名称。</para>
        ///   <para>默认名称基于工具名称和输入图层名称。如果图层名称已存在，系统将提示您提供其他名称。</para>
        /// </xdoc></para>
        /// </param>
        public DetermineTravelCostPathsToDestinations(object _inputDestinationRasterOrFeatures, object _inputCostDistanceRaster, object _inputCostBacklinkRaster, object _outputName)
        {
            this._inputDestinationRasterOrFeatures = _inputDestinationRasterOrFeatures;
            this._inputCostDistanceRaster = _inputCostDistanceRaster;
            this._inputCostBacklinkRaster = _inputCostBacklinkRaster;
            this._outputName = _outputName;
        }
        public override string ToolboxName => "Raster Analysis Tools";

        public override string ToolName => "Determine Travel Cost Paths To Destinations";

        public override string CallName => "ra.DetermineTravelCostPathsToDestinations";

        public override List<string> AcceptEnvironments => ["cellSize", "extent", "mask", "outputCoordinateSystem", "snapRaster"];

        public override object[] ParameterInfo => [_inputDestinationRasterOrFeatures, _inputCostDistanceRaster, _inputCostBacklinkRaster, _outputName, _destinationField, _pathType.GetGPValue(), _outputRaster];

        /// <summary>
        /// <para>Input Destination Raster or Features</para>
        /// <para><xdoc>
        ///   <para>An image service or feature service that identifies the cells from which the least-cost path is determined to the least costly source.</para>
        ///   <para>If the input is an image service, the input consists of cells that have valid values (zero is a valid value), and the remaining cells must be assigned NoData.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>一种影像服务或要素服务，用于标识从中确定成本最低路径到成本最低源的像元。</para>
        ///   <para>如果输入是影像服务，则输入由具有有效值的像元组成（零为有效值），并且必须为其余像元分配 NoData。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Destination Raster or Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputDestinationRasterOrFeatures { get; set; }


        /// <summary>
        /// <para>Input Cost Distance Raster</para>
        /// <para><xdoc>
        ///   <para>The name of a cost distance image service to be used to determine the least-cost path from the destination locations to a source.</para>
        ///   <para>The cost distance raster is usually created with the Calculate Travel Cost tool. The cost distance raster stores, for each cell, the minimum accumulative cost distance over a cost surface from each cell to a set of source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于确定从目标位置到源的最低成本路径的成本距离影像服务的名称。</para>
        ///   <para>成本距离栅格通常使用计算差旅成本工具创建。成本距离栅格存储每个像元在成本图面上从每个像元到一组源像元的最小累积成本距离。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Cost Distance Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputCostDistanceRaster { get; set; }


        /// <summary>
        /// <para>Input Cost Backlink Raster</para>
        /// <para><xdoc>
        ///   <para>The name of a cost back link raster used to determine the path to return to a source via the least-cost path.</para>
        ///   <para>For each cell in the back link raster, a value identifies the neighbor that is the next cell on the least accumulative cost path from the cell to a single source cell or set of source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>成本回溯链接栅格的名称，用于确定通过成本最低路径返回源的路径。</para>
        ///   <para>对于反向链接栅格中的每个像元，一个值用于标识从像元到单个源像元或一组源像元的累积成本最低路径上的下一个像元。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Cost Backlink Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputCostBacklinkRaster { get; set; }


        /// <summary>
        /// <para>Output Name</para>
        /// <para><xdoc>
        ///   <para>The name of the output travel cost paths raster service.</para>
        ///   <para>The default name is based on the tool name and the input layer name. If the layer name already exists, you will be prompted to provide another name.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出差旅成本路径栅格服务的名称。</para>
        ///   <para>默认名称基于工具名称和输入图层名称。如果图层名称已存在，系统将提示您提供其他名称。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _outputName { get; set; }


        /// <summary>
        /// <para>Destination Field</para>
        /// <para><xdoc>
        ///   <para>A field on the destination layer that holds the values that define each destination.</para>
        ///   <para>Input feature service must contain at least one valid field.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>目标图层上保存定义每个目标的值的字段。</para>
        ///   <para>输入要素服务必须至少包含一个有效字段。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Destination Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _destinationField { get; set; } = null;


        /// <summary>
        /// <para>Path Type</para>
        /// <para><xdoc>
        ///   <para>Defines the manner in which the values and zones on the input destination data will be interpreted in the cost path calculations.</para>
        ///   <bulletList>
        ///     <bullet_item>To each cell—For each cell with valid values on the input destination data, a least-cost path is determined and saved on the output raster. With this option, each cell of the input destination data is treated separately, and a least-cost path is determined for each from cell. This is the default.</bullet_item><para/>
        ///     <bullet_item>To each zone—For each zone on the input destination data, a least-cost path is determined and saved on the output raster. With this option, the least-cost path for each zone begins at the cell with the lowest cost distance weighting in the zone.</bullet_item><para/>
        ///     <bullet_item>Best single—For all cells on the input destination data, the least-cost path is derived from the cell with the minimum of the least-cost paths to source cells.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义在成本路径计算中解释输入目标数据的值和区域的方式。</para>
        ///   <bulletList>
        ///     <bullet_item>对于每个像元 - 对于输入目标数据上具有有效值的每个像元，将确定成本最低的路径并将其保存在输出栅格上。使用此选项，将单独处理输入目标数据的每个单元格，并为每个从单元格确定成本最低的路径。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>至每个区域 - 对于输入目标数据上的每个区域，将确定成本最低的路径并将其保存在输出栅格上。使用此选项时，每个区域的最低成本路径从区域中成本距离加权最低的像元开始。</bullet_item><para/>
        ///     <bullet_item>最佳单像元 - 对于输入目标数据上的所有像元，开销最低的路径是从到源像元的开销最低路径的像元派生的。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Path Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _pathType_value _pathType { get; set; } = _pathType_value._EACH_CELL;

        public enum _pathType_value
        {
            /// <summary>
            /// <para>To each cell</para>
            /// <para>To each cell—For each cell with valid values on the input destination data, a least-cost path is determined and saved on the output raster. With this option, each cell of the input destination data is treated separately, and a least-cost path is determined for each from cell. This is the default.</para>
            /// <para>对于每个像元 - 对于输入目标数据上具有有效值的每个像元，将确定成本最低的路径并将其保存在输出栅格上。使用此选项，将单独处理输入目标数据的每个单元格，并为每个从单元格确定成本最低的路径。这是默认设置。</para>
            /// </summary>
            [Description("To each cell")]
            [GPEnumValue("EACH_CELL")]
            _EACH_CELL,

            /// <summary>
            /// <para>To each zone</para>
            /// <para>To each zone—For each zone on the input destination data, a least-cost path is determined and saved on the output raster. With this option, the least-cost path for each zone begins at the cell with the lowest cost distance weighting in the zone.</para>
            /// <para>至每个区域 - 对于输入目标数据上的每个区域，将确定成本最低的路径并将其保存在输出栅格上。使用此选项时，每个区域的最低成本路径从区域中成本距离加权最低的像元开始。</para>
            /// </summary>
            [Description("To each zone")]
            [GPEnumValue("EACH_ZONE")]
            _EACH_ZONE,

            /// <summary>
            /// <para>Best single</para>
            /// <para>Best single—For all cells on the input destination data, the least-cost path is derived from the cell with the minimum of the least-cost paths to source cells.</para>
            /// <para>最佳单像元 - 对于输入目标数据上的所有像元，开销最低的路径是从到源像元的开销最低路径的像元派生的。</para>
            /// </summary>
            [Description("Best single")]
            [GPEnumValue("BEST_SINGLE")]
            _BEST_SINGLE,

        }

        /// <summary>
        /// <para>Output Raster</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Raster")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _outputRaster { get; set; }


        public DetermineTravelCostPathsToDestinations SetEnv(object cellSize = null, object extent = null, object mask = null, object outputCoordinateSystem = null, object snapRaster = null)
        {
            base.SetEnv(cellSize: cellSize, extent: extent, mask: mask, outputCoordinateSystem: outputCoordinateSystem, snapRaster: snapRaster);
            return this;
        }

    }

}